"""
WxApi应用的URL配置
"""

from django.urls import path
from WxApi.view_modules.user_management import (
    wx_loginwx,
    wx_GetUserByOpenId,
    wx_CheckOpenIdExists,
    wx_UpdateUserOpenId,
    wx_ChangePasswordById,
    wx_CheckWechatBinding,
    wx_GetOpenId,
    wx_UpdateUseravatar
)
from WxApi.view_modules.permission_management import (
    GetUserApplications,
    GetAllApplications,
    CreateApplication,
    UpdateApplication,
    ToggleApplicationStatus,
    GetDepartmentUsers,
    GetUserPermissions,
    UpdateUserPermissions,
    GetRolePermissions,
    GetRoleApplications,
    UpdateRolePermissions
)
from WxApi.view_modules.app_center_management import (
    GetAppFilters,
    GetAppCenterList,
    GetAppDetail,
    GetAppCategories,
    GetPendingSubmitList,
    BatchSubmitPending,
    GetSummaryTableList,
    GetSummaryTableDetail,
    GlobalSearch,
    SubmitWorkorder,
    GetWorkorderList
)

app_name = 'WxApi'

urlpatterns = [
    # 用户登录
    path('wx_loginwx/', wx_loginwx.as_view(), name='wx_loginwx'),
    
    # 微信相关接口
    path('wx_GetUserByOpenId/', wx_GetUserByOpenId.as_view(), name='wx_GetUserByOpenId'),
    path('wx_CheckOpenIdExists/', wx_CheckOpenIdExists.as_view(), name='wx_CheckOpenIdExists'),
    path('wx_UpdateUserOpenId/', wx_UpdateUserOpenId.as_view(), name='wx_UpdateUserOpenId'),
    path('wx_CheckWechatBinding/', wx_CheckWechatBinding.as_view(), name='wx_CheckWechatBinding'),
    path('wx_GetOpenId/', wx_GetOpenId.as_view(), name='wx_GetOpenId'),
    
    # 用户管理接口
    path('wx_ChangePasswordById/', wx_ChangePasswordById.as_view(), name='wx_ChangePasswordById'),
    # path('wx_UpdateUseravatar/', wx_GetUserProfile.as_view(), name='wx_GetUserProfile'),
    path('wx_UpdateUseravatar/', wx_UpdateUseravatar.as_view(), name='wx_UpdateUseravatar'),
    
    # 权限管理接口
    path('GetUserApplications/', GetUserApplications.as_view(), name='GetUserApplications'),
    path('GetAllApplications/', GetAllApplications.as_view(), name='GetAllApplications'),
    path('CreateApplication/', CreateApplication.as_view(), name='CreateApplication'),
    path('UpdateApplication/', UpdateApplication.as_view(), name='UpdateApplication'),
    path('ToggleApplicationStatus/', ToggleApplicationStatus.as_view(), name='ToggleApplicationStatus'),
    path('GetDepartmentUsers/', GetDepartmentUsers.as_view(), name='GetDepartmentUsers'),
    path('GetUserPermissions/', GetUserPermissions.as_view(), name='GetUserPermissions'),
    path('UpdateUserPermissions/', UpdateUserPermissions.as_view(), name='UpdateUserPermissions'),
    
    # 角色权限管理接口
    path('GetRolePermissions/', GetRolePermissions.as_view(), name='GetRolePermissions'),
    path('GetRoleApplications/', GetRoleApplications.as_view(), name='GetRoleApplications'),
    path('UpdateRolePermissions/', UpdateRolePermissions.as_view(), name='UpdateRolePermissions'),
    
    # 应用中心管理接口
    path('GetAppFilters/', GetAppFilters.as_view(), name='GetAppFilters'),
    path('GetAppCenterList/', GetAppCenterList.as_view(), name='GetAppCenterList'),
    path('GetAppDetail/', GetAppDetail.as_view(), name='GetAppDetail'),
    path('GetAppCategories/', GetAppCategories.as_view(), name='GetAppCategories'),
    
    # 待提交审核接口
    path('GetPendingSubmitList/', GetPendingSubmitList.as_view(), name='GetPendingSubmitList'),
    path('BatchSubmitPending/', BatchSubmitPending.as_view(), name='BatchSubmitPending'),
    
    # 汇总表一览表接口
    path('GetSummaryTableList/', GetSummaryTableList.as_view(), name='GetSummaryTableList'),
    path('GetSummaryTableDetail/', GetSummaryTableDetail.as_view(), name='GetSummaryTableDetail'),
    
    # 全局搜索接口
    path('GlobalSearch/', GlobalSearch.as_view(), name='GlobalSearch'),
    
    # 工单管理接口
    path('SubmitWorkorder/', SubmitWorkorder.as_view(), name='SubmitWorkorder'),
    path('GetWorkorderList/', GetWorkorderList.as_view(), name='GetWorkorderList'),
]